getDisplayOrDefault

Get the display this context is associated with or the default display as the fallback if the context is not associated with any Display.

Applications must use this method with Activity or a context associated with a Display via createDisplayContext or createWindowContext, or the reported Display instance is not reliable.

Return

The display associated with the Context or the default display if the context doesn't associated with any display.

Parameters

context

Context to obtain the associated display